#ifndef _PLAYER_H_
#define _PLAYER_H_
#include <unistd.h>
#include <DynamicArray.h>
#include <MyString.h>
#include <StdFile.h>
#include "Scene.h"
#include "Prop.h"

typedef struct Player
{
    int hp;
    int attack;
    int def;
    int x;
    int y;
    int exp;
    int level;
    int golden;
    int crit;//暴击
    int parry;//格挡
    int sp;//怒气值
    char symbol[20]; 

    weapon *w;
    defence *d;
    MyStr name;
    //medicament *m;
    //背包系统
    DArray bag;
}player;

typedef struct 
{
    char name[20];
    char passwd[20];
}User;


void InitPlayer(player *p);
void PlayerMove(player *p ,DArray *ms,char* (*map)[MAPSIZE]);
void MenuInterFace(player *p, DArray *ms,char* (*map)[MAPSIZE]);
void SaveFileInterFace(player *p,DArray *ms,char* (*map)[MAPSIZE]);
void LoadFileInterFace(player *p,DArray *ms,char* (*map)[MAPSIZE]);
void PrintPlayer(player *p);
void LevelUp(player *p);

void ShopInterFace(player *p);
void ShowBag(player *p);

MyStr PlayerToString(player *p);

int GetInput();


#endif